<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
	CodeFile="Investigatii.aspx.cs" Inherits="Investigatii" Title="Investigatii" %>

<%@ MasterType VirtualPath="~/MasterPage.master" %>
<%@ Register Namespace="NS_Controls" TagPrefix="cc1" %>
<%@ Register Namespace="CustomControlsNS" TagPrefix="cc2" %>
<asp:Content ID="ContentDefault" ContentPlaceHolderID="ContentPlaceHolderContent"
	runat="Server">
	<link href="../../Styles/themes/fancy/tabs.css" rel="stylesheet" type="text/css" />
	<link href="../../Styles/themes/fancy/fancy-blue/fancy-blue.css" rel="stylesheet"
		type="text/css" />
	<asp:UpdatePanel ID="upWholePage" runat="server">
		<ContentTemplate>
			<div style="padding-bottom: 20px">
				<ajaxToolKit:TabContainer ID="tabContainer" runat="server" CssClass="fancy fancy-blue"
					AutoPostBack="true" OnActiveTabChanged="tabActive_TabChanged">
					<ajaxToolKit:TabPanel ID="tabInvestigation" runat="server" HeaderText="Investigatii">
						<ContentTemplate>
							<div>
								<cc2:CustomButton ID="btnInvSearch" runat="server" Text="" Title="" AccessKey="1"
									OnServerClick="btnSearch_Click" />
								<cc2:CustomButton ID="btnInvAdd" runat="server" Text="" Title="" AccessKey="2" OnServerClick="btnAddInvestigation_Click" />
								<cc2:CustomButton ID="btnInvSave" runat="server" Text="" Title="" AccessKey="3" OnServerClick="btnSaveInvestigation_Click" />
								<cc2:CustomButton ID="btnInvDelete" runat="server" Text="" Title="" AccessKey="4"
									OnServerClick="btnDeleteInvestigation_Click" OnClick='if (!confirm(g_str_CONFIRM_ValidateAnswer)) return false;' />
								<cc2:CustomButton ID="btnSaveRefs" runat="server" Text="" Title="" AccessKey="5"
									OnServerClick="btnSaveRefs_Click" />
								<cc2:CustomButton ID="btnDeleteRefs" runat="server" Text="" Title="" AccessKey="6"
									OnServerClick="btnDeleteRefs_Click" OnClick='if (!confirm(g_str_CONFIRM_ValidateAnswer)) return false;' />
							</div>
							<div id="divSearch" runat="server" style="height: 100%; overflow: auto; display: block;">
								<table width="98%">
									<tr>
										<td>
											<div class="menu_th">
												<table>
													<tr>
														<td>
															<asp:Label ID="lblSearch" runat="server" CssClass="menu_th1">Cautare investigatie</asp:Label>
														</td>
														<td>
															<asp:UpdateProgress ID="UpdateProgressInv" runat="server" DisplayAfter="100">
																<ProgressTemplate>
																	<span class="clsTextBoldYellow">(<% =Resources.GridView.PageLoading %>)</span>
																</ProgressTemplate>
															</asp:UpdateProgress>
														</td>
													</tr>
												</table>
											</div>
											<table width="100%">
												<tr class="tdn">
													<td style="width: 15%">
														Nume investigatie/Grup:
													</td>
													<td style="width: 85%" colspan="3">
														<span class="tdSmall">
															<asp:TextBox ID="txtNameGroup" runat="server" Width="350px" />
															<ajaxToolKit:AutoCompleteExtender runat="server" BehaviorID="AutoCompleteEx" ID="autoCompleteInvName"
																TargetControlID="txtNameGroup" ServicePath="AutoComplete.asmx" ServiceMethod="GetCountryInfo"
																MinimumPrefixLength="1" CompletionInterval="500" EnableCaching="true" CompletionSetCount="20"
																CompletionListCssClass="autocomplete_completionListElement" CompletionListItemCssClass="autocomplete_listItem"
																CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem" DelimiterCharacters=";, :"
																ShowOnlyCurrentWordInCompletionListItem="true">
																<Animations>
																	<OnShow>
																		<Sequence>
																			<%-- Make the completion list transparent and then show it --%>
																			<OpacityAction Opacity="0" />
																			<HideAction Visible="true" />

																			<%--Cache the original size of the completion list the first time
																				the animation is played and then set it to zero --%>
																			<ScriptAction Script="
																				// Cache the size and setup the initial size
																				var behavior = $find('AutoCompleteEx');
																				if (!behavior._height) {
																					var target = behavior.get_completionList();
																					behavior._height = target.offsetHeight - 2;
																					target.style.height = '0px';
																				}" />
                
																			<%-- Expand from 0px to the appropriate size while fading in --%>
																			<Parallel Duration=".4">
																				<FadeIn />
																				<Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx')._height" />
																			</Parallel>
																		</Sequence>
																	</OnShow>
																	<OnHide>
																		<%-- Collapse down to 0px and fade out --%>
																		<Parallel Duration=".4">
																			<FadeOut />
																			<Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx')._height" EndValue="0" />
																		</Parallel>
																	</OnHide>
																</Animations>
															</ajaxToolKit:AutoCompleteExtender>
														</span>
													</td>
												</tr>
												<tr class="tdn">
													<td style="width: 15%">
														Tip aparat:
													</td>
													<td style="width: 35%">
														<span class="tdSmall">
															<asp:DropDownList ID="drpTypeMachinesSearch" runat="server" Width="350px" />
														</span>
													</td>
													<td style="width: 15%">
														Grupuri de investigatii:
													</td>
													<td style="width: 35%">
														<span class="tdSmall">
															<asp:DropDownList ID="drpGroupInvestigation" runat="server" Width="350px" />
														</span>
													</td>
												</tr>
												<tr class="tdn">
													<td>
														Tipuri de probe:
													</td>
													<td>
														<span class="tdSmall">
															<asp:DropDownList ID="drpTypeProbe" runat="server" Width="350px" />
														</span>
													</td>
													<td>
														Active?
													</td>
													<td>
														<span class="tdSmall">
															<asp:DropDownList ID="drpActive" runat="server" Width="350px" />
														</span>
													</td>
												</tr>
											</table>
											<div class="divEndTotal">
											</div>
										</td>
									</tr>
								</table>
							</div>
							<div id="divResultsSearch" runat="server" style="height: 100%; overflow: auto; display: none;">
								<table width="98%">
									<tr valign="top">
										<td>
											<div class="menu_th">
												<asp:Label ID="lblResults" runat="server" CssClass="menu_th">Rezultatele cautarii</asp:Label>
											</div>
											<table width="100%">
												<tr>
													<td>
														<table border="0" width="100%">
															<tr class="tdh">
																<td style="width: 25%">
																	Numele investigatiei
																</td>
																<td style="width: 14%">
																	Cod
																</td>
																<td style="width: 25%">
																	Aparat
																</td>
																<td style="width: 14%">
																	Grup
																</td>
																<td style="width: 14%">
																	Proba
																</td>
																<td style="width: 8%">
																	Activa
																</td>
															</tr>
														</table>
														<div style="overflow: auto; height: auto; vertical-align: top; width: 100%">
															<asp:Repeater ID="rptInvestigation" runat="server">
																<HeaderTemplate>
																	<table border="0" width="100%">
																		<tbody>
																</HeaderTemplate>
																<ItemTemplate>
																	<tr class="tdn">
																		<td style="width: 25%">
																			<asp:LinkButton ID="lnkButtonInvestigation" CssClass="redFont" runat="server" OnClick="LoadDetailsInvestigation_Click"
																				CommandArgument='<%# Eval("[TypeID]")%>'>
																				<%# Server.HtmlEncode(DataBinder.Eval(Container.DataItem, "Name").ToString())%>
																			</asp:LinkButton>
																		</td>
																		<td style="width: 14%">
																			<%# Server.HtmlEncode(DataBinder.Eval(Container.DataItem, "Code").ToString())%>
																		</td>
																		<td style="width: 25%">
																			<span class="greenFont">
																				<%# Server.HtmlEncode(DataBinder.Eval(Container.DataItem, "MachineName").ToString())%></span>
																		</td>
																		<td style="width: 14%">
																			<%# Server.HtmlEncode(DataBinder.Eval(Container.DataItem, "GroupName").ToString())%>
																		</td>
																		<td style="width: 14%">
																			<%# Server.HtmlEncode(DataBinder.Eval(Container.DataItem, "SampleTypeName").ToString())%>
																		</td>
																		<td style="width: 8%">
																			<span class="blueFont">
																				<%# Server.HtmlEncode(DataBinder.Eval(Container.DataItem, "Status").ToString())%>
																				<asp:LinkButton ID="lnkRefsSearchButton" CssClass="redFont" runat="server" OnClick="LoadRefs_Click">
																					<span class="redFont">
																						<%# System.Convert.ToInt32(Eval("[refs]")) == 0 ? "[Fara Referinta]": ""%>
																					</span>
																				</asp:LinkButton>
																			</span>
																		</td>
																	</tr>
																</ItemTemplate>
																<FooterTemplate>
																		</tbody>
																	</table>
																</FooterTemplate>
															</asp:Repeater>
														</div>
													</td>
												</tr>
											</table>
											<div class="divEndTotal">
											</div>
										</td>
									</tr>
									<tr>
										<td>
											<asp:Label ID="lblCount" runat="server" Text="" CssClass="redFont" />
										</td>
									</tr>
								</table>
							</div>
							<div id="divInvestigationDetails" runat="server" style="height: 100%; overflow: auto;
								display: none;">
								<table width="98%">
									<tr>
										<td>
											<div class="menu_th">
												<asp:Label ID="lblDetailsInvest" runat="server" CssClass="menu_th1"></asp:Label>
											</div>
											<table width="100%">
												<tr id="trRefs" runat="server" class="tdn">
													<td colspan="4">
														<span class="redFont"><b>Aceasta investigatie nu are inca rezultate de referinta, deci
															nu va putea fi adaugata in cererile de investigatii paraclinice. </span>
													</td>
												</tr>
												<tr class="tdn">
													<td style="width: 15%">
														<span class="redFont"><u>Numele investigatiei:</u></span>
													</td>
													<td style="width: 35%">
														<span class="tdSmall">
															<asp:TextBox ID="txtNameInvestDet" runat="server" Width="350px" />
														</span>
													</td>
													<td style="width: 15%">
														Codul Intern:
													</td>
													<td style="width: 35%">
														<span class="tdSmall">
															<asp:TextBox ID="txtCodIntern" runat="server" Width="350px" />
														</span>
													</td>
												</tr>
												<tr class="tdn">
													<td>
														Numele pentru CAS:
													</td>
													<td>
														<asp:TextBox ID="txtNameCAS" runat="server" Width="350px" />
													</td>
													<td>
														Codul pentru CAS:
													</td>
													<td>
														<span class="tdSmall">
															<asp:TextBox ID="txtCodCAS" runat="server" Width="350px" />
														</span>
													</td>
												</tr>
												<tr class="tdn">
													<td>
														<span class="redFont"><u>Tipul aparatului:</u></span>
													</td>
													<td colspan="3">
														<span class="tdSmall">
															<asp:DropDownList ID="drpMachineDetails" runat="server" Width="350px" />
														</span>
													</td>
												</tr>
												<tr class="tdn">
													<td>
														Este activa?
													</td>
													<td>
														<span class="tdSmall">
															<asp:CheckBox ID="chkActive" runat="server" />
														</span>
													</td>
													<td style="display: none;">
														Inteligenta artificiala oprita?
													</td>
													<td style="display: none;">
														<span class="tdSmall">
															<asp:CheckBox ID="chkIA" runat="server" />
														</span>
													</td>
													<td>
														Are valori normale?
													</td>
													<td>
														<span class="tdSmall">
															<asp:CheckBox ID="chkNormalValues" runat="server" />
														</span>
													</td>
												</tr>
												<tr class="tdn">
													<td>
														Este printabila?
													</td>
													<td>
														<span class="tdSmall">
															<asp:CheckBox ID="chkPrintable" runat="server" />
														</span>
													</td>
													<td>
														Afisare rezultate inline?
													</td>
													<td>
														<span class="tdSmall">
															<asp:CheckBox ID="chkResultsInline" runat="server" />
														</span>
													</td>
												</tr>
												<tr class="tdn">
													<td style="display: none;">
														Este platit de CAS?
													</td>
													<td style="display: none;">
														<span class="tdSmall">
															<asp:CheckBox ID="chkPaymentCAS" runat="server" />
														</span>
													</td>
													<td>
														Afiseaza capul de tabel?
													</td>
													<td colspan="3">
														<span class="tdSmall">
															<asp:CheckBox ID="chkTableHeader" runat="server" />
														</span>
													</td>
												</tr>
												<tr class="tdn">
													<td>
														<span class="redFont"><u>Grupul de Investigatii:</u></span>
													</td>
													<td>
														<span class="tdSmall">
															<asp:DropDownList ID="drpInvestigationGroup" runat="server" Width="350px" />
														</span>
													</td>
													<td>
														<span class="redFont"><u>Tipul probei:</u></span>
													</td>
													<td>
														<span class="tdSmall">
															<asp:DropDownList ID="drpProbeType" runat="server" Width="350px" />
														</span>
													</td>
												</tr>
												<tr class="tdn">
													<td>
														Descriere:
													</td>
													<td colspan="3">
														<span class="tdSmall">
															<asp:TextBox ID="txtDescription" runat="server" Width="350px" TextMode="MultiLine"
																Height="50px" />
														</span>
													</td>
												</tr>
												<tr class="tdn">
													<td>
														Pe ecran:
													</td>
													<td>
														X:
														<asp:TextBox ID="txtXI" runat="server" Style="width: 10%" />
														Y:
														<asp:TextBox ID="txtYI" runat="server" Style="width: 10%" />
														Z:
														<asp:TextBox ID="txtZI" runat="server" Style="width: 10%" />
													</td>
													<td>
														La imprimanta:
													</td>
													<td>
														<span class="tdSmall">X:
															<asp:TextBox ID="txtXP" runat="server" Style="width: 10%" />
															Y:
															<asp:TextBox ID="txtYP" runat="server" Style="width: 10%" />
															Z:
															<asp:TextBox ID="txtZP" runat="server" Style="width: 10%" />
														</span>
													</td>
												</tr>
												<tr class="tdn">
													<td>
														Sectii restrictionate:<br />
														<span class="greenFont">(deselectati pentru a ridica restrictia)</span>
													</td>
													<td colspan="3">
														<asp:PlaceHolder ID="plcSectionsRestricted" runat="server" />
													</td>
												</tr>
												<tr class="tdn">
													<td>
														Sectii libere:<br />
														<span class="greenFont">(selectati pentru a restrictiona)</span>
													</td>
													<td colspan="3">
														<asp:PlaceHolder ID="plcSectionFree" runat="server" />
													</td>
												</tr>
											</table>
											<div class="divEndTotal">
											</div>
										</td>
									</tr>
									<tr>
										<td>
											<div id="divRefs" runat="server" style="height: 100%; overflow: auto; display: block;">
												<table width="98%">
													<tr valign="top">
														<td>
															<div class="menu_th">
																<span class="menu_th">Referintele investigatiei</span>
																<asp:LinkButton ID="lnkAddRefs" CssClass="redFont" runat="server" OnClick="btnAddRefs_Click">
																	<span class="redFont" style="font-size: 12px"><u>(Adauga Referinta)</u></span>
																</asp:LinkButton>
															</div>
															<table width="100%">
																<tr>
																	<td>
																		<table border="0" width="100%">
																			<tr class="tdh">
																				<td style="width: 12%">
																					&nbsp;
																				</td>
																				<td style="width: 40%">
																					Nume
																				</td>
																				<td style="width: 12%">
																					Cod Masina
																				</td>
																				<td style="width: 12%">
																					X
																				</td>
																				<td style="width: 12%">
																					Y
																				</td>
																				<td style="width: 12%">
																					Activa
																				</td>
																			</tr>
																		</table>
																		<div style="overflow: auto; height: auto; vertical-align: top; width: 100%">
																			<asp:Repeater ID="rptRefs" runat="server">
																				<HeaderTemplate>
																					<table border="0" width="100%">
																						<tbody>
																				</HeaderTemplate>
																				<ItemTemplate>
																					<tr class="tdn">
																						<td style="width: 12%">
																							<asp:LinkButton ID="lnkButtonRef" CssClass="redFont" runat="server" OnClick="LoadRefs_Click"
																								CommandArgument='<%# Eval("[ID]")%>'>
																									<%# Server.HtmlEncode(DataBinder.Eval(Container.DataItem, "ID").ToString())%>
																							</asp:LinkButton>
																						</td>
																						<td style="width: 40%">
																							<%# Server.HtmlEncode(DataBinder.Eval(Container.DataItem, "Name").ToString())%>
																						</td>
																						<td style="width: 12%">
																							<span class="greenFont">
																								<%# Server.HtmlEncode(DataBinder.Eval(Container.DataItem, "Code").ToString())%></span>
																						</td>
																						<td style="width: 12%">
																							<%# Server.HtmlEncode(DataBinder.Eval(Container.DataItem, "ScreenX").ToString())%>
																						</td>
																						<td style="width: 12%">
																							<%# Server.HtmlEncode(DataBinder.Eval(Container.DataItem, "ScreenY").ToString())%>
																						</td>
																						<td style="width: 12%">
																							<%# Server.HtmlEncode(DataBinder.Eval(Container.DataItem, "Active").ToString())%>
																						</td>
																					</tr>
																				</ItemTemplate>
																				<FooterTemplate>
																					</tbody> </table>
																				</FooterTemplate>
																			</asp:Repeater>
																		</div>
																	</td>
																</tr>
															</table>
															<div class="divEndTotal">
															</div>
														</td>
													</tr>
												</table>
											</div>
										</td>
									</tr>
								</table>
							</div>
							<div id="divRefsDetails" runat="server" style="height: 100%; overflow: auto; display: none;">
								<table width="98%">
									<tr>
										<td>
											<div class="menu_th">
												<table>
													<tr>
														<td>
															<asp:LinkButton ID="lnkRefDetails" CssClass="redFont" runat="server" OnClick="LoadDetailsInvestigation_Click">
																<asp:Label ID="lblRefs" runat="server" CssClass="menu_th1"></asp:Label>
															</asp:LinkButton>
														</td>
													</tr>
												</table>
											</div>
											<table width="100%">
												<tr>
													<td>
														<table width="100%">
															<tr class="tdn">
																<td style="width: 25%">
																	<span class="redFont"><u>Investigatia:</u></span>
																</td>
																<td style="width: 75%" colspan="3">
																	<span class="redFont">
																		<asp:LinkButton ID="lnkButtonRef" CssClass="redFont" runat="server" OnClick="LoadDetailsInvestigation_Click">
																			<asp:Label ID="lblName" runat="server" />
																		</asp:LinkButton>
																	</span>
																</td>
															</tr>
															<tr class="tdn">
																<td style="width: 25%">
																	Nume:
																</td>
																<td style="width: 25%">
																	<span class="tdSmall">
																		<asp:TextBox ID="txtRefName" runat="server" Width="350px" />
																	</span>
																</td>
																<td style="width: 25%">
																	Cod Intern:
																</td>
																<td style="width: 25%">
																	<span class="tdSmall">
																		<asp:TextBox ID="txtRefCod" runat="server" Width="350px" />
																	</span>
																</td>
															</tr>
															<tr class="tdn">
																<td>
																	<span class="tdSmall">Unitate de masura :</span>
																</td>
																<td>
																	<span class="tdSmall">
																		<asp:DropDownList ID="drpUnitRefs" runat="server" Width="350px" />
																	</span>
																</td>
																<td>
																	<span class="tdSmall">Tipul rezultatului: </span>
																</td>
																<td>
																	<span class="tdSmall">
																		<asp:DropDownList ID="drpResultRef" runat="server" Width="350px" />
																	</span>
																</td>
															</tr>
															<tr class="tdn">
																<td valign="top">
																	<span class="tdSmall">Lista de valori:</span>
																	<br />
																	(separate prin ";")
																</td>
																<td>
																	<span class="tdSmall">
																		<asp:TextBox ID="txtListRefs" runat="server" Width="350px" TextMode="MultiLine"
																			Height="40px" />
																	</span>
																</td>
																<td valign="top">
																	<span class="tdSmall">Selectie multipla</span>
																	<br />
																	<span class="tdSmall">Este printabila</span>
																</td>
																<td valign="top">
																	<asp:CheckBox ID="chkSelMultipleRef" runat="server" />
																	<br />
																	<asp:CheckBox ID="chkPrintableRef" runat="server" />
																</td>
															</tr>
															<tr class="tdn">
																<td>
																	<span class="tdSmall">Activa:</span>
																</td>
																<td colspan="3">
																	<asp:CheckBox ID="chkACtiveRef" runat="server" />
																</td>
															</tr>
															<tr class="tdn">
																<td>
																	<span class="tdSmall">Pozitionare:</span>
																</td>
																<td>
																	<span class="tdSmall">Pe ecran:</span>
																	<asp:TextBox ID="txtSRX" runat="server" Width="30px" />
																	<asp:TextBox ID="txtSRY" runat="server" Width="30px" />
																	<asp:TextBox ID="txtSRZ" runat="server" Width="30px" />
																</td>
																<td colspan="2">
																	<span class="tdSmall">La imprimanta:</span>
																	<asp:TextBox ID="txtPRX" runat="server" Width="30px" />
																	<asp:TextBox ID="txtPRY" runat="server" Width="30px" />
																	<asp:TextBox ID="txtPRZ" runat="server" Width="30px" />
																</td>
															</tr>
														</table>
													</td>
												</tr>
											</table>
											<div class="divEndTotal">
											</div>
										</td>
									</tr>
									<tr>
										<td>
											<div id="div" runat="server" style="height: 100%; overflow: auto; display: block;">
												<table width="100%" cellspacing="2" id="tblNormalValues">
													<thead class="tdh">
														<th style="width: 12%">
															&nbsp;&nbsp;
														</th>
														<th style="width: 12%">
															Sex
														</th>
														<th style="width: 14%">
															Varsta minima
														</th>
														<th style="width: 14%">
															Varsta maxima
														</th>
														<th style="width: 24%">
															Minim
														</th>
														<th style="width: 24%">
															Maxim
														</th>
													</thead>
													<tbody class="tdnB">
														<tr>
															<td colspan="6" align="right">
																<!-- @ ~/Scripts/Hipocrate.js -->
																<u><a href='javascript:addNewInterval();'><span class="redFont">Adauga</u></span></a>
															</td>
														</tr>
													</tbody>
												</table>
												<div class="divEndTotal">
												</div>
											</div>
										</td>
									</tr>
									<tr>
										<td>
											<div id="divTypes" runat="server" style="height: 100%; overflow: auto; display: block;">
												<div class="menu_th">
													<asp:Label ID="lblType" runat="server" CssClass="menu_th">Tipuri de rezultate </asp:Label>
												</div>
												<table width="100%" id="tblTypes">
													<tr>
														<td class="tdh" style="width: 18%">
															Nume
														</td>
														<td class="tdh" style="width: 76%" align="right">
															<asp:DropDownList ID="drpTypesRefs" runat="server" Width="300px" />
														</td>
														<td class="tdh" style="width: 6%" align="right">
															<a href="javascript:addType()">
																<img src="../../Images/Hipocrate/add.gif" border="0" alt="Click pentru a adauga"
																	width="32" height="30"></a> </a>
														</td>
													</tr>
												</table>
												<div class="divEndTotal">
												</div>
											</div>
										</td>
									</tr>
								</table>
							</div>
						</ContentTemplate>
					</ajaxToolKit:TabPanel>
					<ajaxToolKit:TabPanel ID="tabResults" runat="server" HeaderText="Tipuri Rezultate">
						<ContentTemplate>
							<div>
								<cc2:CustomButton ID="btnSaveResults" runat="server" Text="Salveaza Rezultate" Title="Salveaza Rezultate"
									OnServerClick="btnSaveResults_Click" AccessKey="3" />
							</div>
							<table width="98%">
								<tr>
									<td>
										<div class="menu_th">
											<table>
												<tr>
													<td>
														<asp:Label ID="lblResultsType" runat="server" CssClass="menu_th1">Tipuri de rezultate: </asp:Label>
													</td>
													<td>
														<asp:UpdateProgress ID="UpdateProgressResults" runat="server" DisplayAfter="100">
															<ProgressTemplate>
																<span class="clsTextBoldYellow">(<% =Resources.GridView.PageLoading %>)</span>
															</ProgressTemplate>
														</asp:UpdateProgress>
													</td>
												</tr>
											</table>
										</div>
									</td>
								</tr>
							</table>
							<div id="divResults" style="height: 98%; overflow: auto;">
								<table width="98%">
									<tr valign="top">
										<td>
											<cc1:ExtendedGridView runat="server" ID="grResults" UseDefaultStyle="true" ShowEditLink="true"
												ShowInsertLink="true" AutoSave="true" AllowSorting="true" AllowPaging="true"
												showDeleteButton="true" showEditButton="false" PageSize="15" AutoGenerateColumns="true"
												DataKeyNames="ID" EnableFilter="true" EnablePageSize="true" EnableExport="false"
												OnRowDataBound="GridView_RowDataBound" AutoGenerateEditButton="false" Width="100%">
												<Columns>
													<asp:TemplateField HeaderText="D">
														<ItemTemplate>
															<asp:ImageButton runat="server" ID="btnDelete" AlternateText="<%$ Resources:GridView, Delete %>"
																ImageUrl="~/Images/Btn/delete.gif" OnClick="imgDelete_Click" OnClientClick='if (!confirm(g_str_CONFIRM_ValidateAnswer)) return false;' />
														</ItemTemplate>
													</asp:TemplateField>
												</Columns>
											</cc1:ExtendedGridView>
										</td>
									</tr>
								</table>
							</div>
							<div class="divEnd">
							</div>
						</ContentTemplate>
					</ajaxToolKit:TabPanel>
					<ajaxToolKit:TabPanel ID="tabProbes" runat="server" HeaderText="Tipuri Probe">
						<ContentTemplate>
							<div>
								<cc2:CustomButton ID="btnProbes" runat="server" Text="Salveaza Probe" Title="Salveaza Probe"
									OnServerClick="btnSaveProbes_Click" AccessKey="3" />
							</div>
							<table width="98%">
								<tr>
									<td>
										<div class="menu_th">
											<table>
												<tr>
													<td>
														<asp:Label ID="lblProbes" runat="server" CssClass="menu_th1">Tipuri de probe: </asp:Label>
													</td>
													<td>
														<asp:UpdateProgress ID="updateProgressProbes" runat="server" DisplayAfter="100">
															<ProgressTemplate>
																<span class="clsTextBoldYellow">(<% =Resources.GridView.PageLoading %>)</span>
															</ProgressTemplate>
														</asp:UpdateProgress>
													</td>
												</tr>
											</table>
										</div>
									</td>
								</tr>
							</table>
							<div id="divProbes" style="height: 100%; overflow: auto;">
								<table width="98%">
									<tr valign="top">
										<td>
											<cc1:ExtendedGridView runat="server" ID="grProbes" UseDefaultStyle="true"
												ShowEditLink="true" ShowInsertLink="true" AutoSave="true" AllowSorting="true"
												AllowPaging="true" showDeleteButton="true" showEditButton="false" PageSize="15"
												AutoGenerateColumns="true" DataKeyNames="ID" EnableFilter="true" EnablePageSize="true"
												EnableExport="false" OnRowDataBound="GridView_RowDataBound" AutoGenerateEditButton="false"
												Width="100%">
												<Columns>
													<asp:TemplateField HeaderText="D">
														<ItemTemplate>
															<asp:ImageButton runat="server" ID="btnDelete" AlternateText="<%$ Resources:GridView, Delete %>"
																ImageUrl="~/Images/Btn/delete.gif" OnClick="imgDeleteProbes_Click" OnClientClick='if (!confirm(g_str_CONFIRM_ValidateAnswer)) return false;' />
														</ItemTemplate>
													</asp:TemplateField>
												</Columns>
											</cc1:ExtendedGridView>
										</td>
									</tr>
								</table>
							</div>
							<div class="divEnd">
							</div>
						</ContentTemplate>
					</ajaxToolKit:TabPanel>
					<ajaxToolKit:TabPanel ID="tabUnits" runat="server" HeaderText="Unitati Masura">
						<ContentTemplate>
							<div>
								<cc2:CustomButton ID="btnAddUnits" runat="server" Text="Adauga Unitate Masura" Title="Adauga Unitate"
									OnServerClick="btnAddUnits_Click" AccessKey="2" />
							</div>
							<table width="98%">
								<tr>
									<td>
										<div class="menu_th">
											<table>
												<tr>
													<td>
														<asp:Label ID="lblUnits" runat="server" CssClass="menu_th1">Unitati de masura </asp:Label>
													</td>
													<td>
														<asp:UpdateProgress ID="UpdateProgressUM" runat="server" DisplayAfter="100">
															<ProgressTemplate>
																<span class="clsTextBoldYellow">(<% =Resources.GridView.PageLoading %>)</span>
															</ProgressTemplate>
														</asp:UpdateProgress>
													</td>
												</tr>
											</table>
										</div>
									</td>
								</tr>
							</table>
							<div id="divRepeaterUM" style="height: 400px; overflow: auto;">
								<table width="98%">
									<tr valign="top" id="trUnits" visible="true" runat="server">
										<td>
											<table border="0" width="100%">
												<tr class="tdh">
													<td style="width: 10%">
														&nbsp;
													</td>
													<td style="width: 45%">
														Nume
													</td>
													<td style="width: 45%">
														Simbol
													</td>
												</tr>
											</table>
											<div style="overflow: auto; height: auto; vertical-align: top; width: 100%">
												<asp:Repeater ID="rptUnits" runat="server">
													<HeaderTemplate>
														<table border="0" width="100%">
															<tbody>
													</HeaderTemplate>
													<ItemTemplate>
														<tr class="tdn">
															<td style="width: 10%">
																<asp:LinkButton ID="lnkButton" CssClass="redFont" runat="server" OnClick="LoadUnitsID_Click"
																	CommandArgument='<%# Eval("[Name]") + "," + Eval("[Symbol]") + "," + Eval("[ID]")%>'>
																	<asp:ImageButton runat="server" ID="btnEdit" AlternateText="<%$ Resources:GridView, Edit %>"
																		ImageUrl="~/Images/Edit.gif" CommandArgument='<%# Eval("[Name]")+ "," + Eval("[Symbol]") + "," + Eval("[ID]")%>'
																		OnClick="LoadUnitsID_Click" />
																	Edit
																</asp:LinkButton>
															</td>
															<td style="width: 45%">
																<%# Server.HtmlDecode(DataBinder.Eval(Container.DataItem, "Name").ToString().Replace("[","<").Replace("]",">"))%>
															</td>
															<td style="width: 45%">
																<%# Server.HtmlDecode(DataBinder.Eval(Container.DataItem, "Symbol").ToString().Replace("[","<").Replace("]",">"))%>
															</td>
														</tr>
													</ItemTemplate>
													<FooterTemplate>
															</tbody>
														</table>
													</FooterTemplate>
												</asp:Repeater>
											</div>
										</td>
									</tr>
								</table>
							</div>
							<div class="divEnd">
							</div>
						</ContentTemplate>
					</ajaxToolKit:TabPanel>
				</ajaxToolKit:TabContainer>
				<div id="divLinkHome" style="padding: 10px">
					<asp:Image runat="Server" ID="imgReturnMain" ImageUrl="~/Images/Hipocrate/icon_home.gif"
						AlternateText="Click to return" UseSubmitBehavior="false" Style="cursor: pointer" />
					<asp:HyperLink ID="lnkMainPage" runat="server" Text="Inapoi la pagina principala"
						NavigateUrl="~/Default.aspx" />
				</div>
			</div>
		</ContentTemplate>
	</asp:UpdatePanel>
	<asp:Button ID="btnShowPopup" runat="server" Style="display: none" />
	<ajaxToolKit:ModalPopupExtender ID="mdlPopupUnits" runat="server" TargetControlID="btnShowPopup"
		PopupControlID="pnlPopupUM" CancelControlID="CancelButtonUM" BackgroundCssClass="modalBackground"
		PopupDragHandleControlID="pnDragHandleSelectionUM" RepositionMode="RepositionOnWindowResizeAndScroll">
	</ajaxToolKit:ModalPopupExtender>
	<asp:Panel ID="pnlPopupUM" runat="server" CssClass="modalPopup" Style="display: none;"
		Width="500px">
		<table style="background-color: #87cefa; border: solid 1px Gray; width: 500px">
			<tr>
				<td width="100%" align="center">
					<asp:Panel runat="server" ID="pnDragHandleSelectionUM" Style="cursor: move;">
						<b style="color: White">Editare Unitate Masura</b>
					</asp:Panel>
				</td>
				<td>
					<asp:Image ID="CancelButtonUM" AccessKey="c" runat="server" ImageUrl="~/Images/Hipocrate/icon_post_delete.gif"
						Style="cursor: pointer" title="<%$ Resources:DatabaseStrings, Close %>" />
				</td>
			</tr>
		</table>
		<asp:UpdatePanel ID="upUnits" runat="server" UpdateMode="Conditional">
			<ContentTemplate>
				<table width="98%">
					<tr valign="top">
						<td>
							<br />
							<div class="menu_th">
								<asp:Label ID="lblTitle" runat="server" CssClass="menu_th">Unitate de masura</asp:Label>
							</div>
							<table width="100%">
								<tr>
									<td>
										<table border="0" width="100%">
											<tr class="tdh">
												<td style="width: 15%">
													Numele:&nbsp;
												</td>
												<td style="width: 35%">
													<span class="tdSmall">
														<asp:TextBox ID="txtName" runat="server" Style="width: 92%" />
													</span>
												</td>
												<td style="width: 15%">
													Simbolul:&nbsp;
												</td>
												<td style="width: 35%">
													<span class="tdSmall">
														<asp:TextBox ID="txtSymbol" runat="server" Style="width: 92%" />
													</span>
												</td>
											</tr>
											<tr class="tdh">
												<td colspan="4">
													<span style="font-size: smaller">
														<br />
														Observatii:
														<ul style="margin-top: -4px">
															<li>Este recomandat ca numele unitatii de masura
																sa fie la plural.
															</li>
															<li>Pentru tag-uri HTML folositi in loc
																de paranteze unghiulare <> pe cele drepte [].
															</li>
														</ul>
														
													</span>
												</td>
											</tr>
											<tr class="tdh" id="trWarning" runat="server" style="display: none">
												<td colspan="4">
													<span style="font-size: smaller" class="redFont">*Completati campurile cerute!</span>
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
							<div class="divEnd">
							</div>
							<div style="text-align: center;">
								<cc2:CustomButton ID="btnSaveUnits" runat="server" Text="Salveaza" Title="Salveaza"
									OnServerClick="btnSaveUnits_Click" AccessKey="7" />
								<cc2:CustomButton ID="btnDelete" runat="server" Text="Sterge" Title="Sterge" OnServerClick="btnDeleteUnits_Click"
									AccessKey="8" OnClick='if (!confirm(g_str_CONFIRM_ValidateAnswer)) return false;' />
								<cc2:CustomButton ID="btnCloseUnits" runat="server" Text="Inchide" Title="Inchide"
									AccessKey="9" />
							</div>
						</td>
					</tr>
				</table>
			</ContentTemplate>
		</asp:UpdatePanel>
	</asp:Panel>
	<script language="javascript" type="text/javascript">
		var g_str_CONFIRM_ValidateAnswer = '<% =Resources.DatabaseStrings.CONFIRM_DeleteReport.ReplaceApostrophe() %>';
		var g_str_mdlPopupUnits = '<%=mdlPopupUnits.ClientID %>';
		var g_str_divRepeater = 'divRepeaterUM';
		var g_str_tblNormalValues = 'tblNormalValues';
		var g_str_tblTypes = 'tblTypes';
		var g_str_drpTypesRefs = '<%=drpTypesRefs.ClientID %>';
		$addHandler(document, "keydown", onKeyDown);

		function windowTop(div) {
			var location = Sys.UI.DomElement.getLocation($get(div));
			$get(g_str_divRepeater).scrollTop = location.y - 300;
		}

		function onKeyDown(e) {
			if (e && e.keyCode == Sys.UI.Key.esc) {
				$find(g_str_mdlPopupUnits).hide();
			}
		}
	</script>
</asp:Content>
